package com.cn.util.jvm;

public class JvmInfo {
	
	public static long getTotalMemory(){
		return Runtime.getRuntime().totalMemory();
	}
	public static long getMaxMemory(){
		return Runtime.getRuntime().maxMemory();
	}
	public static long getFreeMemory(){
		return Runtime.getRuntime().freeMemory();
	}
	public static void main(String[] args) {
		System.out.println("total : "+JvmInfo.getTotalMemory()/1024/1024);
		System.out.println("max : "+JvmInfo.getMaxMemory()/1024/1024);
		System.out.println("free : "+JvmInfo.getFreeMemory()/1024/1024);
		
		System.out.println("total : "+JvmInfo.getTotalMemory()/1024/1024);
		System.out.println(JvmInfo.getFreeMemory()/1024/1024);
	}
}
